package com.hefeng.common.core.config;

import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Service;

import java.io.IOException;
import java.util.Map;

/**
 * @author HZH
 * 系统参数，修改系统参数需要重启tomcat，才能生效
 */


public class BaseStaticParameter {
    //public static Map  <String, Resident> residentMap ;
    public static final String WXAPPID = "wxd92cdfabd388a722";
    public static final String WXSECRET = "f56f69b69abdbdeb7e90ad60296abfd1";
    //工业端
    public static final String UNITAPPID = "wx217390826b4407ae";
    public static final String UNITSECRET = "55d7c7eb4109107bdf055834cb7ee0a5";

    //38所接口地址
    public static  String SERVEURL="http://pub.api.cetcsafe.com/czhf/";
    //家庭传感器地址
    public static  String HOMEDEVURL ="https://hefengzhxf.oss-cn-guangzhou.aliyuncs.com/gas/jiating.jpg";

    public static String ACCESSTOKEN="";
    //获取微信接口调用凭证
    public static  String getAccessTokenUrl="https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid="+WXAPPID+"&secret="+WXSECRET;
    //微信消息模板
    public static  String TEMPLATEID="q1__-KaKejad8yluNtrRBsSJPJVwulqmkvbv7xMLNMs";




   /* public void run(ApplicationArguments args) throws Exception {
        getAccessToken(getAccessTokenUrl);
        //setData();
    }*/
    //获取微信请求ACCESSTOKEN
    /*public void getAccessToken(String getAccessTokenUrl) throws IOException {
        HttpRequester requester = new HttpRequester();
        HttpRespons respons= requester.sendGet(getAccessTokenUrl);
        JSONObject token = JSONObject.parseObject(respons.getContent());
        ACCESSTOKEN=token.getString("access_token");

    }*/

    /*public void setData(){
        ResidentService residentService = (ResidentService) SpringContextUtils.getBean("residentService");
        residentMap =  residentService.getResidentMap();
    }*/


}
